//
//  HCAppointmentContentView.m
//  HappyChildren
//
//  Created by WillyZhao on 2016/12/29.
//  Copyright © 2016年 WillyZhao. All rights reserved.
//

#import "HCAppointmentContentView.h"

#import "HCNavAnimationView.h"
#import "HCAppointContentTableViewCell.h"

@interface HCAppointmentContentView () <UITableViewDelegate,UITableViewDataSource>

@end

@implementation HCAppointmentContentView

-(instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self loadViewsCustom:frame];
    }
    return self;
}

-(void)loadViewsCustom:(CGRect)frame {
    HCNavAnimationView *navAnimationView = [[HCNavAnimationView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, YBKAdaptiveH(40))];
    [self addSubview:navAnimationView];
    
    self.contentTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, navAnimationView.frame.origin.y+navAnimationView.frame.size.height, frame.size.width, frame.size.height - navAnimationView.frame.size.height)];
    self.contentTableView.delegate = self;
    self.contentTableView.dataSource = self;
    self.contentTableView.rowHeight = self.contentTableView.frame.size.height/3.0;
    self.contentTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self addSubview:self.contentTableView];
    
    [self.contentTableView registerNib:[UINib nibWithNibName:@"HCAppointContentTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"cellappointment"];
    
}

#pragma mark UITableView代理
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HCAppointContentTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellappointment" forIndexPath:indexPath];
    return cell;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
